<template>
  <div>
    <van-nav-bar title="问诊" left-arrow @click-left="onClickLeft" />
    <van-notice-bar
      left-icon="volume-o"
      text="重要：急重症不适合网上咨询，请立即前往当地医院就诊"
    />
    <div class="boxa">
      <p><span>选择档案</span><span>+新增档案</span></p>
    </div>
    <div class="boxb">
      <span>病情描述</span>
      <div class="a">
        <textarea placeholder="病情描述" v-model="text"></textarea>
      </div>
      <div class="b">
        <span>上传检查单/患处照片（选填，最多9张）</span>
        <van-uploader :after-read="afterRead" />
      </div>
    </div>
    <div class="boxc">
      <van-cell title="预约时间" is-link value="选择时间" />
    </div>
    <div class="boxd">
      <van-cell title="服务类型" value="">
        <van-radio-group v-model="checked" direction="horizontal">
          <van-radio name="1">¥100/次(10分钟)</van-radio>
          <van-radio name="2">¥138/次(15分钟)</van-radio>
        </van-radio-group>
      </van-cell>
    </div>
    <div class="boxe">
      <van-cell title="联系电话" value="">
        {{ phone }}
      </van-cell>
    </div>
    <div class="read">
      <p>买前必读</p>
      <p>
        1.服务流程：预约成功后，医生将在到达预约时间前3分钟左右发起视频，请提前至订单详情页面等待
      </p>
      <p>2.因医生工作繁忙，可能更改预约时间，届时会第一时间通知您</p>
      <p>3.为保证视频问诊效率，建议您事先准备好病情资料（如检查、患处照片）</p>
      <p>4.如视频失败，本次咨询不收取费用，如视频过程中意外中断，可在规定时间内继续重连</p>
      <p>5.视频通话期间，请确保网络通畅，等待医生来电</p>
    </div>
    <div class="of">
      <button>去支付</button>
    </div>
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const onClickLeft = () => {
  router.go(-1)
}
const phone = ref(localStorage.getItem('phone') || '')
const checked = ref('1')
const text = ref('')
</script>
<style>
template {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.of {
  display: flex;
  justify-content: center;
  width: 100%;
  height: 50px;
  align-items: center;
  background-color: #fff;
  position: fixed;
  bottom: 0;
  padding: 0 10px;
  box-sizing: border-box;
  box-shadow: 0 -1px 10px #ccc;
  z-index: 99;
  .read {
    padding: 10px;
    font-size: 12px;
    color: #666;
  }
  button {
    width: 90%;
    height: 40px;
    background-color: #39d167;
    color: #fff;
    border: none;
  }
}
.boxa {
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  margin-top: 20px;
  font-size: 14px;
  height: 150px;
  background-color: #fff;
  span:nth-child(1) {
    color: #333;
  }
  span:nth-child(2) {
    color: #39d167;
  }
}
.boxb {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 14px;
  height: 150px;
  background-color: #fff;
  width: 100%;
  flex-direction: column;
  .a {
    width: 100%;
    height: 100px;
    textarea {
      width: 100%;
      height: 100%;
    }
  }
  .b {
    display: flex;
    justify-content: space-between;
  }
  span {
    color: #333;
  }
  .van-uploader {
    width: 100%;
  }
  .van-uploader__preview {
    width: 100px;
    height: 100px;
  }
  .van-uploader__preview-image {
    width: 100px;
    height: 100px;
  }
  .van-uploader__preview-delete {
    top: 0;
    right: 0;
  }
  .van-uploader__preview-delete--disabled {
    display: none;
  }
}
.boxc {
  margin-top: 20px;
}
.boxd {
  .van-cell {
    position: relative;
    display: flex;
    box-sizing: border-box;
    width: 100%;
    padding: var(--van-cell-vertical-padding) var(--van-cell-horizontal-padding);
    overflow: hidden;
    color: var(--van-cell-text-color);
    font-size: var(--van-cell-font-size);
    line-height: var(--van-cell-line-height);
    background: var(--van-cell-background);
  }
  margin-top: 20px;
}
.boxe {
  margin-top: 20px;
  .van-cell {
    position: relative;
    display: flex;
    box-sizing: border-box;
    width: 100%;
    padding: var(--van-cell-vertical-padding) var(--van-cell-horizontal-padding);
    overflow: hidden;
    color: var(--van-cell-text-color);
    font-size: var(--van-cell-font-size);
    line-height: var(--van-cell-line-height);
    background: var(--van-cell-background);
  }
}
.read {
  margin-top: 20px;
  padding: 50px 5px;
  font-size: 12px;
  position: relative;
  bottom: 0px;
  left: 0px;
  width: 100%;
}
</style>
